/*
 * @Author: yangni 920556271@qq.com
 * @Date: 2024-03-13 11:50:19
 * @LastEditors: yangni 920556271@qq.com
 * @LastEditTime: 2024-04-21 16:19:54
 * @FilePath: /yt-devops/lib/pages/devices/device_tab/device_detail/new_air_cooling_page/component/gun_charging_type.dart
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import 'package:get/get.dart';
import 'package:yt_devops/resources/str_res_keys.dart';

/**
 *
 * @Description TODO
 * @Author liuer
 * @CreateTime 2024年03月11日 09:32
 */
class GunCharging {
  ///充电方式
  static String getChargingType(Map map) {
    var chargingType = '--';
    if (map != null && map['chargingType'] == 0) {
      chargingType = ResKey.deviceCard.tr;
    } else if (map != null && map['chargingType'] == 1) {
      chargingType = ResKey.deviceApp.tr;
    } else if (map != null && map['chargingType'] == 2) {
      chargingType = ResKey.deviceLocalManage.tr;
    } else if (map != null && map['chargingType'] == 3) {
      chargingType = ResKey.deviceVin.tr;
    } else if (map != null && map['chargingType'] == 4) {
      chargingType = ResKey.devicePassword.tr;
    } else if (map != null && map['chargingType'] == 5) {
      chargingType = ResKey.thingsHandMovement.tr;
      // '手动';
    }
    return chargingType;
  }

  ///获取充电策略
  static String getChargingStrategy(Map map) {
    var chargingStrategy = '--';
    if (map != null && map['chargingStrategy'] == 0) {
      chargingStrategy = ResKey.deviceHand.tr;
    } else if (map != null && map['chargingStrategy'] == 1) {
      chargingStrategy = ResKey.deviceAuto.tr;
    } else if (map != null && map['chargingStrategy'] == 2) {
      chargingStrategy = ResKey.deviceMoney.tr;
    } else if (map['chargingStrategy'] == 3) {
      chargingStrategy = ResKey.deviceQuantity.tr;
    } else if (map != null && map['chargingStrategy'] == 4) {
      chargingStrategy = ResKey.deviceQuantity.tr;
    }
    return chargingStrategy;
  }

  static String getServerType(Map map) {
    var serverType = '--';
    if (map != null && map['serverType'] == 1) {
      serverType = '中石化';
    } else if (map != null && map['serverType'] == 2) {
      serverType = '小桔';
    } else if (map != null && map['serverType'] == 3) {
      serverType = '联合快充';
    } else if (map != null && map['serverType'] == 4) {
      serverType = '暂无';
    } else if (map != null && map['serverType'] == 5) {
      serverType = '速充';
    } else if (map != null && map['serverType'] == 6) {
      serverType = '国网电动';
    } else if (map != null && map['serverType'] == 7) {
      serverType = '三盈';
    } else if (map != null && map['serverType'] == 8) {
      serverType = '中核汇能';
    } else if (map != null && map['serverType'] == 9) {
      serverType = '普天';
    } else if (map != null && map['serverType'] == 10) {
      serverType = '星星充电';
    } else if (map != null && map['serverType'] == 11) {
      serverType = '协鑫';
    } else if (map != null && map['serverType'] == 12) {
      serverType = '三盈双平台监控后台';
    } else if (map != null && map['serverType'] == 13) {
      serverType = '云快充等';
    }
    return serverType;
  }

  static String getGunType(Map map) {
    var gunType = '--';
    if (map != null && map['serverType'] == 1) {
      gunType = ResKey.deviceDC.tr;
    } else if (map != null && map['serverType'] == 2) {
      gunType = ResKey.deviceAC.tr;
    }
    return gunType;
  }

  static String getSourceType(Map map) {
    var sourceType = '--';
    if (map != null && map['sourceType'] == 0) {
      sourceType = '12V';
    } else if (map != null && map['sourceType'] == 1) {
      sourceType = '24V';
    }
    return sourceType;
  }
}
